import 'package:flutter/material.dart';
import 'package:convex_bottom_bar/convex_bottom_bar.dart';

var convex_bottom_bar_component = {
  'ConvexAppBar': (props) => ConvexAppBar(
    key: props['key'],
    items: List<TabItem>.from(props['items']),
    initialActiveIndex: props['initialActiveIndex'],
    disableDefaultTabController: props['disableDefaultTabController'],
    onTap: props['onTap'],
    onTabNotify: props['onTabNotify'],
    controller: props['controller'],
    color: props['color'],
    activeColor: props['activeColor'],
    backgroundColor: props['backgroundColor'],
    gradient: props['gradient'],
    height: props['height']?.toDouble(),
    curveSize: props['curveSize']?.toDouble(),
    top: props['top']?.toDouble(),
    elevation: props['elevation']?.toDouble(),
    cornerRadius: props['cornerRadius']?.toDouble(),
    style: props['style'] ?? TabStyle.reactCircle,
    curve: props['curve'] ?? Curves.easeInOut,
    chipBuilder: props['chipBuilder'],
  ),
  'ConvexAppBar.builder': (props) => ConvexAppBar.builder(
    key: props['key'],
    itemBuilder: props['itemBuilder'],
    count: props['count'],
    initialActiveIndex: props['initialActiveIndex'],
    disableDefaultTabController:
    props['disableDefaultTabController'] ?? false,
    onTap: props['onTap'],
    onTapNotify: props['onTapNotify'],
    controller: props['controller'],
    backgroundColor: props['backgroundColor'],
    gradient: props['gradient'],
    height: props['height']?.toDouble(),
    curveSize: props['curveSize']?.toDouble(),
    top: props['top']?.toDouble(),
    elevation: props['elevation']?.toDouble(),
    cornerRadius: props['cornerRadius']?.toDouble(),
    curve: props['curve'] ?? Curves.easeInOut,
    chipBuilder: props['chipBuilder'],
  ),
  'ConvexAppBar.badge': (props) => ConvexAppBar.badge(
    props['pa'][0],
    key: props['key'],
    badgeTextColor: props['badgeTextColor'],
    badgeColor: props['badgeColor'],
    badgePadding: props['badgePadding'],
    badgeMargin: props['badgeMargin'],
    badgeBorderRadius: props['badgeBorderRadius']?.toDouble(),
    items: List<TabItem>.from(props['items']),
    initialActiveIndex: props['initialActiveIndex'],
    disableDefaultTabController:
    props['disableDefaultTabController'] ?? false,
    onTap: props['onTap'],
    onTabNotify: props['onTabNotify'],
    controller: props['controller'],
    color: props['color'],
    activeColor: props['activeColor'],
    backgroundColor: props['backgroundColor'],
    gradient: props['gradient'],
    height: props['height']?.toDouble(),
    curveSize: props['curveSize']?.toDouble(),
    top: props['top']?.toDouble(),
    elevation: props['elevation']?.toDouble(),
    cornerRadius: props['cornerRadius']?.toDouble(),
    style: props['style'] ?? TabStyle.reactCircle,
    curve: props['curve'] ?? Curves.easeInOut,
  ),
  'ConvexAppBarState': (props) => ConvexAppBarState(),
  'StyleProvider': (props) => StyleProvider(
    key: props['key'],
    style: props['style'],
    child: props['child'],
  ),
  'StyleProvider.of': (props) => StyleProvider.of(
    props['pa'][0],
  ),
  'TabStyle': {
    'values': TabStyle.values,
    'fixed': TabStyle.fixed,
    'fixedCircle': TabStyle.fixedCircle,
    'react': TabStyle.react,
    'reactCircle': TabStyle.reactCircle,
    'textIn': TabStyle.textIn,
    'titled': TabStyle.titled,
    'flip': TabStyle.flip,
    'custom': TabStyle.custom,
  },
  'TabItem': (props) => TabItem(
    title: props['title'],
    icon: props['icon'],
    activeIcon: props['activeIcon'],
    isIconBlend: props['isIconBlend'],
  ),
  'ConvexButton': (props) => ConvexButton(
    key: props['key'],
    size: props['size']?.toDouble(),
    sigma: props['sigma']?.toDouble(),
    child: props['child'],
    thickness: props['thickness']?.toDouble(),
    backgroundColor: props['backgroundColor'],
    top: props['top']?.toDouble(),
  ),
  'ConvexButton.fab': (props) => ConvexButton.fab(
    key: props['key'],
    size: props['size']?.toDouble(),
    thickness: props['thickness']?.toDouble(),
    top: props['top']?.toDouble(),
    sigma: props['sigma']?.toDouble(),
    iconSize: props['iconSize']?.toDouble() ?? 32,
    border: props['border']?.toDouble() ?? 2,
    color: props['color'] ?? Colors.redAccent,
    icon: props['icon'] ?? Icons.keyboard_voice,
    backgroundColor: props['backgroundColor'],
    onTap: props['onTap'],
  ),
};
